// +----------------------------------------------------------------------
// | 跃飞 [ 将来的你一定会感激现在奋斗的自己 ]
// +----------------------------------------------------------------------
// | Author: 钟贵廷
// +----------------------------------------------------------------------
// | Author URI: https://git.oschina.net/yeafy
// +----------------------------------------------------------------------
// | weChat:gt845272922  qq:845272922
// +----------------------------------------------------------------------

//回到顶部
$(function(){
    var back = $('.back');
    back.click(function() {
        var timer = setInterval(function(){
            $(window).scrollTop($(window).scrollTop()-50);
            if($(window).scrollTop() == 0){
                clearInterval(timer);
            }
        },2);
    });

    $(window).scroll(function() {
        if($(window).scrollTop() < 100){
            back.hide(500);
        } else {
            back.show(500);
        }
    });

});